﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Projekt
{
    public partial class mainForm : Form
    {
        private Dalgen conn;
        public mainForm()
        {
            InitializeComponent();
            try
            {
                conn = Dalgen.Instance;
                conn.OpenConnection();
            }
            catch (Exception es)
            {
                MessageBox.Show(es.ToString());
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        private void megtekintesToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void ujToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new new_firm();
            kl.Show();
        }

        private void szerkesztToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            Form kl = new firm_view();
            kl.Show();
        }

        private void torlesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            
        }

        private void newShopMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new newShop();
            kl.Show();
        }

        private void editShopMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new editShop();
            kl.Show();
        }

        private void mainExitMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void introduceBillMenuItem_Click(object sender, EventArgs e)
        {
            introduceBill kl = new introduceBill();
            if (kl.accesible()) { kl.Show(); }
        }

        private void newProduceMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new newProduce();
            if (kl!=null) kl.Show();
        }

        private void editProduceMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new editProduce1();
            kl.Show();
        }

        private void billMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void editBillMenuItem_Click(object sender, EventArgs e)
        {
            introduceBill kl = new introduceBill("205");
            if (kl.accesible()) { kl.Show(); } 
        }

        private void archiveBillMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new billArchive();
            kl.Show();
        }

        private void statMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void howMuchBuysIn1MonthToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form kl = new stat();
            kl.Show();
        }

    }
}
